package org.codert.web;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.util.NoSuchElementException;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-06-04 15:47
 **/
@ControllerAdvice
public class ExceptionHand {

    @ExceptionHandler(NoSuchElementException.class)
    public String hhh(Exception e) {
        return e.getMessage();
    }

    @ExceptionHandler(Exception.class)
    public String hh(Exception e) {
        return e.getMessage();
    }


}
